<?php
/**
 * @copyright meila.com
 * @author shaopu@
 * @name 检测昵称是否可用
 * @param 
 *         $nick = 作用
 * 
 * 
 */
include('../__global.php');

class aj_integrity extends ml_controller 
{

    function initParam(){}
    /**
     * @develop_template
     * 检查参数合法性
     */
    function checkParam(){
    $this->check_referer();}
    /**
     * @develop_template
     * 核心业务逻辑
     */
    function main()
    {
        //获取uid
        $uid = $this->__visitor['uid'];
        
        //初始化
        $data['Degrees'] = 0;
        
        //判断邮箱
        if (!empty($this->__visitor['email'])){
            $data['Degrees'] += 40;
        }
        
        //实例化用户模型饼判断微博帐号
        $oBrief = new ml_model_dbUserBriefInfo();
        $oBrief->getPersonByUid($uid);
        $briefData=$oBrief->get_data();
        if (!empty($briefData['weibo_address'])){
            $data['Degrees'] += 30;
        }
        
        //实例化用户附加信息模型
        $oExt = new ml_model_dbUserExtInfo();
        $oExt->getPersonByUid($uid);
        
        $extData = $oExt->get_data();
        //判断出生信息
        if ($extData['birthday']!='0000-00-00'){
            $data['Degrees'] += 10;
        }
        
        //判断血型信息
        if ($extData['blood_type']){
            $data['Degrees'] += 5;
        }
        
        //判断兴趣关键字信息
        if (!empty($extData['interest_tags'])){
            $data['Degrees'] += 5;
        }
        
        $this->api_output(ML_RCODE_SUCC,$data);
    }
}

new aj_integrity();
